package com.matrix.java.chap_05;

import java.util.Scanner;

/*
    显示金字塔
 */
public class Ex5_17 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the number of lines: ");
        int num = input.nextInt();
        for (int i = 1; i <= num; i++) {
            for (int j = 0; j < (num - i) * 2; j++) {
                System.out.print(" ");
            }
            for (int j = i; j > 0; j--) {
                System.out.print(j + " ");
            }
            for (int j = 2; j <= i; j++) {
                System.out.print(j + " ");
            }
            System.out.println();
        }
        input.close();
    }
}
